package com.financing.wap.service.payment.baofoo.demo;

/**
 * 
 */



public class TESTDemo {

	/**
	 * @param args
	 * @throws Exception
	 */
	public static void main(String[] args) throws Exception {
		String nokeyParam ="version=4.0.0&member_id=100000178&terminal_id=100000859&txn_type=3001&txn_sub_type=01351&data_type=json";
		String keyParam ="{\"txn_sub_type\":\"01351\",\"biz_type\":\"0000\",\"terminal_id\":\"100000859\",\"member_id\":\"100000178\",\"trans_serial_no\":\"20155901715221\",\"trans_id\":\"20155907215134331\",\"id_card_type\":\"null\",\"id_card\":\"测试\",\"id_holder\":\"340828199001021485\",\"card_type\":\"null\",\"valid_date\":\"null\",\"valid_no\":\"null\",\"pay_code\":\"null\",\"trade_date\":\"20150508152131\",\"clientIp\":\"10.0.20.80\"}";
		String prikeyPath="D:/BAOFOO_CHECK_CARD/CER/m_pri.pfx";
		String cerPath = "D:/BAOFOO_CHECK_CARD/CER/baofoo_pub.cer";
		String pwd="123456";
		String postUrl = "https://tgw.baofoo.com/livesplatform/api/backTransRequest";//测试环境
		//"https://public.baofoo.com/livesplatform/api/backTransRequest"; //正式
		
		String getParam= ServeService.getParam(nokeyParam, keyParam, prikeyPath, pwd);
		System.out.println("请求参数："+getParam);
		String return_string = ServeService.post(postUrl, getParam);
		System.out.println("返回内容："+return_string);
		String decryptStr = ServeService.DeResponseStr(return_string, cerPath);
		System.out.println("解密返回内容："+decryptStr);
	}
}
	
